﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class RestaurantTypeController
    {
        public int InsertRestaurantType(RestaurantTypeInfo info)
        {
            return SQL.InsertRestaurantType(info.RestaurantTypeName, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void UpdateRestaurantType(RestaurantTypeInfo info)
        {
            SQL.UpdateRestaurantType(info.RestaurantTypeId, info.RestaurantTypeName, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void DeleteRestaurantType(RestaurantTypeInfo info)
        {
            DeleteRestaurantType(info.RestaurantTypeId);
        }
        public void DeleteRestaurantType(int restaurantTypeId)
        {
            SQL.DeleteRestaurantType(restaurantTypeId);
        }
        public RestaurantTypeInfo GetRestaurantType(int restaurantTypeId)
        {
            return CBO.FillObject<RestaurantTypeInfo>(SQL.GetRestaurantType(restaurantTypeId));
        }
        public List<RestaurantTypeInfo> ListRestaurantType()
        {
            return CBO.FillCollection<RestaurantTypeInfo>(SQL.ListRestaurantType());
        }
        public DataTable SelectRestaurantType()
        {
            return CBO.ConvertToDataTable(ListRestaurantType(), typeof(RestaurantTypeInfo));
        }
        public Dictionary<object, object> ListRestaurantTypeLookup()
        {
            var pages = ListRestaurantType();
            return pages.ToDictionary<RestaurantTypeInfo, object, object>(info => info.RestaurantTypeId, info => info.RestaurantTypeName);
        }
    }
}
